//
//  NewsSingleCell.swift
//  SinaNews
//
//  Created by hroot on 15/8/14.
//  Copyright (c) 2015年 Lily. All rights reserved.
//

import UIKit

class NewsSingleCell: UITableViewCell {

    @IBOutlet weak var headImage: UIImageView!
    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var detailLabel: UILabel!
    @IBOutlet weak var commentImage: UIImageView!
    @IBOutlet weak var commentLabel: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        self.selectionStyle = UITableViewCellSelectionStyle.None
    }

    func showData(model: NewsModel) -> Void {
        self.headImage.sd_setImageWithURL(NSURL(string: model.kpic!), placeholderImage: UIImage(named: "icon"))
        self.titleLabel!.text = model.title
        self.detailLabel.text = model.intro
        self.commentImage.image = UIImage(named: "feed_cell_commentIcon")
        if (model.comment_count_info != nil) {
            var commentDict:NSDictionary = model.comment_count_info!
            var commentNumber = commentDict.valueForKey("total")!.integerValue
            self.commentLabel.text = "\(commentNumber)"
        } else {
            self.commentLabel.text = "0"
        }
        
    }
    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    
    
    
    
    
    
    
    
    
    
}
